package com.pan.java;

import java.util.Scanner;

public class ArrayTest1 {
	public static void main(String[] args) {
			//录入学生人数。
		    Scanner scan = new Scanner(System.in);
			System.out.println("请输入学生人数");
			int num = scan.nextInt();
			
			//录入学生成绩
			int[] score = new int[num-1];
			for(int i = 0 ; i <=score.length ; i++){
				System.out.println("请输入第"+(i+1)+"名学生成绩");
				score[i] = scan.nextInt();
			}
			
			//判定最高分
			int max = score[0];
			for(int i = 1 ; i <=score.length ; i++){
				if(max<score[i]){
					max = score[i];
				}
			}
			
			//判定等级	
			String[] level1 = new String[num-1];
			for(int i = 0; i <= level1.length; i++){
				if(max - score[i] <= 10){
					level1[i] = "A";
				}else if(max - score[i] <= 20){
					level1[i] = "B";
				}else if(max - score[i] <= 30){
					level1[i] = "C";
			    }else{
				    level1[i] = "D";
			    }
					  System.out.println("student "+i+" score is "+score[i]+" grade is "+level1[i]);
			}
			
				//输出
			  //System.out.println("最高分是："+max);
			  //for(int i = 0; i<= score.length;i++){
				//  System.out.println("student "+i+" score is "+score[i]+" grade is "+level[i]);
			  //}
	}
}

